package ejb;

import java.util.Date;
import javax.naming.*;

public class Util {
  public static Integer nextId() {
    return Integer.valueOf((int)new Date().getTime());
  }

  public static CargaSemanalFuncionarioLocalHome getCargaSemanalFuncionarioHome() {
    try {
      return (CargaSemanalFuncionarioLocalHome)new InitialContext().lookup(
        "local/CargaSemanalFuncionarioBean"
      );
    } catch (NamingException e) {
      return null;
    }
  }

  public static CargaSemanalProjetoLocalHome getCargaSemanalProjetoHome() {
    try {
      return (CargaSemanalProjetoLocalHome)new InitialContext().lookup(
        "local/CargaSemanalProjetoBean"
      );
    } catch (NamingException e) {
      return null;
    }
  }

  public static ClienteLocalHome getClienteHome() {
    try {
      return (ClienteLocalHome)new InitialContext().lookup(
        "local/ClienteBean"
      );
    } catch (NamingException e) {
      return null;
    }
  }

  public static FaturaLocalHome getFaturaHome() {
    try {
      return (FaturaLocalHome)new InitialContext().lookup(
        "local/FaturaBean"
      );
    } catch (NamingException e) {
      return null;
    }
  }

  public static FuncionarioLocalHome getFuncionarioHome() {
    try {
      return (FuncionarioLocalHome)new InitialContext().lookup(
        "local/FuncionarioBean"
      );
    } catch (NamingException e) {
      return null;
    }
  }

  public static GerenteLocalHome getGerenteHome() {
    try {
      return (GerenteLocalHome)new InitialContext().lookup(
        "local/GerenteBean"
      );
    } catch (NamingException e) {
      return null;
    }
  }

  public static MensagemLocalHome getMensagemHome() {
    try {
      return (MensagemLocalHome)new InitialContext().lookup(
        "local/MensagemBean"
      );
    } catch (NamingException e) {
      return null;
    }
  }

  public static ProjetoLocalHome getProjetoHome() {
    try {
      return (ProjetoLocalHome)new InitialContext().lookup(
        "local/ProjetoBean"
      );
    } catch (NamingException e) {
      return null;
    }
  }

  public static RequerimentoHoraExtraLocalHome getRequerimentoHoraExtraHome() {
    try {
      return (RequerimentoHoraExtraLocalHome)new InitialContext().lookup(
        "local/RequerimentoHoraExtraBean"
      );
    } catch (NamingException e) {
      return null;
    }
  }
}
